<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.4.4.min.js"></script>
<html>
<body>

login
    <form action="${pageContext.request.contextPath}/login.do" method="post">
        姓名：<input name="username" type="text"><br>
        年龄：<input name="age" type="number" ><br>
        <input type="submit">
    </form>
loginValid
    <form action="${pageContext.request.contextPath}/loginValid.do" method="post">
        姓名：<input name="name" type="text"><br>
        年龄：<input name="age" type="number" ><br>
        <input type="submit">
    </form>
loginValidated
    <form action="${pageContext.request.contextPath}/loginValidated.do" method="post">
        姓名：<input name="name" type="text"><br>
        年龄：<input name="age" type="number" ><br>
        <input type="submit">
    </form>

loginValidatedGroup
<form action="${pageContext.request.contextPath}/loginValidatedGroup.do" method="post">
    姓名：<input name="name" type="text"><br>
    年龄：<input name="age" type="number" ><br>
    <input type="submit">
</form>

customerValid
<form action="${pageContext.request.contextPath}/customerValid.do" method="post">
    姓名：<input name="name" type="text"><br>
    年龄：<input name="age" type="number" ><br>
    性别：
    <select name="sex" >
        <option value="">请选择</option>
        <option value="男">男</option>
        <option value="女">女</option>
    </select><br>
    几个孩子： <input name="childrenCount" type="number" ><br>
   <%-- <input name="childrenCount" type="radio" value="1">1
    <input name="childrenCount" type="radio" value="2">2
    <input name="childrenCount" type="radio" value="3">3--%>
    <br>
    <input type="submit">
</form>

personValidator，@InitBinder 只对当前controller有效
<form action="${pageContext.request.contextPath}/personValidator.do" method="post">
    姓名：<input name="username" type="text"><br>
    年龄：<input name="age" type="number" ><br>
    <input type="submit">
</form>

<br>

<a href="javaScript:void(0)" onclick="findUserById()">findUserById.do</a><br><br>
<a href="javaScript:void(0)" onclick="updateUserById()">updateUserById.do</a><br><br>



</body>
<script type="text/javascript">
    function findUserById() {
        var url = "${pageContext.request.contextPath}/findUserById.do?i=0";
        $.get(url, function (data) {
            console.log(data.age+";"+data.username);
        });
    }
    function updateUserById() {
        var url = "${pageContext.request.contextPath}/updateUserById.do?i=0";
        $.post(url, function (data) {
            console.log(data);
        });
    }
</script>
</html>
